﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OrderTest
{
    [Serializable]
    public class Order
    {
        public int Id { get; set; }
        public string customer { get; set; }
        public string StuffType { get; set; }

        public double price { get; set; }

        public override bool Equals(object? obj)
        {
            Order o = obj as Order;
            return (o != null &&  o.customer == customer && 
                o.StuffType ==StuffType && o.price == o.price || (o.Id == Id));
        }

        public override int GetHashCode()
        {
            return HashCode.Combine(Id,customer,StuffType,price);
        }
        
        //public override string ToString()
        //{
        //    return "Order ID:" + Id + "\t" + customer.ToString() + "\t" + stuff.ToString();
        //}
    }
}
